package com.atguigu.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: robert.song
 * @Date: Created in 2021/8/6
 */
@RestController
@RefreshScope
public class ConfigClientController {
    @Value("${config.info}")
    private String info;
    @Value("${application.config.name}")
    private String info2;
    @Value("${application.test}")
    private String info3;
    @Value("${application.ext-info}")
    private String info4;
//    @Value("${application.config.name}")
//    private String info4;
    @GetMapping("/config/info")
    public String getConfigInfo(){
        return info;
    }
    @GetMapping("/config/info2")
    public String getConfigInfo2(){
        return info2;
    }
    @GetMapping("/config/info3")
    public String getConfigInfo3(){
        return info3;
    }
    @GetMapping("/config/info4")
    public String getConfigInfo4(){
        return info4;
    }
}
